package ie.dcu.spca.view.item;

import com.quietlycoding.android.picker.NumberPicker;

import ie.dcu.spca.R;
import android.view.View;
import android.widget.TextView;
import android.widget.SimpleAdapter.ViewBinder;

public class UserCountViewBuilder implements ViewBinder {

    @Override
    public boolean setViewValue(View view, Object data, String text) {
        if (view.getId() == R.id.nameTextView) {
            ((TextView) view).setText(text);
        } else if (view.getId() == R.id.userCountNP) {
            ((NumberPicker) view).setCurrent(Integer.parseInt(text));
        }
        return true;
    }

}
